package com.share.order.api;

import com.share.common.core.constant.ServiceNameConstants;
import com.share.common.core.domain.Result;
import com.share.order.domain.OrderInfo;
import com.share.order.fallback.RemoteOrderInfoFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 订单服务 远程调用Client
 */
@FeignClient(
        contextId = "remoteOrderInfoService",
        value = ServiceNameConstants.ORDER_SERVICE,
        fallbackFactory = RemoteOrderInfoFallback.class) //降级类fallback
public interface RemoteOrderInfoService {

    @GetMapping("/orderInfo/getNoFinishOrder/{userId}")
    public Result<OrderInfo> getNoFinishOrder(@PathVariable("userId") Long userId);


}
